//声明式导航
import { Link } from 'react-router-dom';
//编程式导航
import { useNavigate } from 'react-router-dom';
const Login = () => {
    const navigate = useNavigate();
    return (
        <div>
            <h1>Login</h1>
            {/* 声明式导航 */}
            <Link to='/acticle'>文章页</Link>
            {/* 命令式导航 */}
            <button onClick={() => navigate('/acticle')}>文章页</button>
            {/* 传参数  searchparams传参*/}
            <button onClick={() => navigate('/acticle?id=1001&name=jack')}>传参文章页</button>
            {/* params传参 需要在路由后面加:id */}
            <button onClick={() => navigate('/acticle/1001')}>params传参文章页</button>
        </div>
    );
};
export default Login;